168
A Little Bit of Computer Science
168
If Statement
A conditional statement that is executed only if a condition is
fulfilled. Its syntax is
If <condition > then
<statement>
Else
<statement>
End If
Index
Also a variable, must be numeric
Its sole purpose is to provide the sequence for an array
For example, ALPHA(I) is an array and I is its index. It can be
varied from 0 to N, N being the number of cells it is designed to
have. The limit N is set by the Dim statement
Initialization
Setting of values at the beginning of a program. Generally
speaking, a variable, whether declared or undeclared in VBA,
assumes a value of null if string and zero if numeric.
Instr function
A statement to find at what position a sub-string occurs in a string.
For example, INSTR (“ABCDE”,”CDE”) returns the number 3
because CDE is in the third position in the string “ABCDE”. If
the string is not found, the value returned is zero.
Iteration counter
A variable used to keep track of how many times a set of statements
has been executed.
For I = 1 to 100
<statement>
<statement>
:
<statement>
Next
I is the iteration counter in the example above and is automatically
incremented by 1
Iterative statement
See FOR statement
Label
Attribute f a graphical element
Modulus Operation
Divides 2 operands and identifies the remainder
MsgBox
A message that is displayed on the screen. It has only one
parameter—a string variable.
Multiply Operation
Multiply two operands
Next statement
The ending statement of a For Loop
Once the system encounters this statement, it completes one
iteration and goes in for the next after checking the iteration
condition.
Object
A generic name for items with complex structures that cannot be
described with a simple data type. For example, a workbook is an
object and the worksheet is also an object
On Error
A statement to detect any error that takes place in the next
statement without knowing what error it is. Used with RESUME
or GOTO.